package com.xsir.ditan.miniprogram.exception;

import com.xsir.ditan.miniprogram.common.Result;
import com.xsir.ditan.miniprogram.common.ResultStatus;

/**
 * @author user
 * @date 2021/2/1
 */
public class CustomException extends RuntimeException{
    private Integer errorCode;
    private String errorMsg;
    
    public CustomException() {
        super();
    }
    
    public CustomException(ResultStatus status) {
        super(status.msg());
        errorCode = status.code();
        errorMsg = status.msg();
    }
    
    public Integer getErrorCode() {
        return errorCode;
    }
    
    public String getErrorMsg() {
        return errorMsg;
    }
    
    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }
    
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}

